home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / Reference / DevCon / Orlando_1993 / Devcon93.4 / Networking2 / AS225 / include / protocols / timed.h < prev   
Encoding:
C/C++ Source or Header  |  1993-01-11  |  2.9 KB  |  79 lines

  1. /*
  2.  * Copyright (c) 1983 Regents of the University of California.
  3.  * All rights reserved.
  4.  *
  5.  * Redistribution and use in source and binary forms are permitted
  6.  * provided that the above copyright notice and this paragraph are
  7.  * duplicated in all such forms and that any documentation,
  8.  * advertising materials, and other materials related to such
  9.  * distribution and use acknowledge that the software was developed
  10.  * by the University of California, Berkeley.  The name of the
  11.  * University may not be used to endorse or promote products derived
  12.  * from this software without specific prior written permission.
  13.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  14.  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  15.  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  16.  *
  17.  *    @(#)timed.h    1.8 (Berkeley) 6/27/88
  18.  */
  19.  
  20. /*
  21.  * Time Synchronization Protocol
  22.  */
  23.  
  24. #define    TSPVERSION    1
  25. #define ANYADDR     NULL
  26.  
  27. struct tsp {
  28.     u_char    tsp_type;
  29.     u_char    tsp_vers;
  30.     u_short    tsp_seq;
  31.     union {
  32.         struct timeval tspu_time;
  33.         char tspu_hopcnt;
  34.     } tsp_u;
  35.     char tsp_name[MAXHOSTNAMELEN];
  36. };
  37.  
  38. #define    tsp_time    tsp_u.tspu_time
  39. #define    tsp_hopcnt    tsp_u.tspu_hopcnt
  40.  
  41. /*
  42.  * Command types.
  43.  */
  44. #define    TSP_ANY            0    /* match any types */
  45. #define    TSP_ADJTIME        1    /* send adjtime */
  46. #define    TSP_ACK            2    /* generic acknowledgement */
  47. #define    TSP_MASTERREQ        3    /* ask for master's name */ 
  48. #define    TSP_MASTERACK        4    /* acknowledge master request */
  49. #define    TSP_SETTIME        5    /* send network time */
  50. #define    TSP_MASTERUP        6    /* inform slaves that master is up */
  51. #define    TSP_SLAVEUP        7    /* slave is up but not polled */
  52. #define    TSP_ELECTION        8    /* advance candidature for master */
  53. #define    TSP_ACCEPT        9    /* support candidature of master */
  54. #define    TSP_REFUSE        10    /* reject candidature of master */
  55. #define    TSP_CONFLICT        11    /* two or more masters present */
  56. #define    TSP_RESOLVE        12    /* masters' conflict resolution */
  57. #define    TSP_QUIT        13    /* reject candidature if master is up */
  58. #define    TSP_DATE        14    /* reset the time (date command) */
  59. #define    TSP_DATEREQ        15    /* remote request to reset the time */
  60. #define    TSP_DATEACK        16    /* acknowledge time setting  */
  61. #define    TSP_TRACEON        17    /* turn tracing on */
  62. #define    TSP_TRACEOFF        18    /* turn tracing off */
  63. #define    TSP_MSITE        19    /* find out master's site */
  64. #define    TSP_MSITEREQ        20    /* remote master's site request */
  65. #define    TSP_TEST        21    /* for testing election algo */
  66. #define    TSP_SETDATE        22    /* New from date command */
  67. #define    TSP_SETDATEREQ        23    /* New remote for above */
  68. #define    TSP_LOOP        24    /* loop detection packet */
  69.  
  70. #define    TSPTYPENUMBER        25
  71.  
  72. #ifdef TSPTYPES
  73. char *tsptype[TSPTYPENUMBER] =
  74.   { "ANY", "ADJTIME", "ACK", "MASTERREQ", "MASTERACK", "SETTIME", "MASTERUP", 
  75.   "SLAVEUP", "ELECTION", "ACCEPT", "REFUSE", "CONFLICT", "RESOLVE", "QUIT", 
  76.   "DATE", "DATEREQ", "DATEACK", "TRACEON", "TRACEOFF", "MSITE", "MSITEREQ",
  77.   "TEST", "SETDATE", "SETDATEREQ", "LOOP" };
  78. #endif
  79.